﻿Imports System.Data
Imports System.Data.OleDb

Public Class QueryDB

    Public Function ExecuteString(ByVal SearchString As String)

        Dim Con As New connection
        Dim Constr As New OleDbConnection
        Constr = Con.ConnectionString()

        Dim cmd As OleDbCommand = New OleDbCommand(SearchString, Constr)
        Constr.Open()
        cmd.ExecuteNonQuery()
        Constr.Close()

        '*******************************************************

    End Function


    Public Function PerformSearch(ByVal SearchString As String)

        Dim Con As New connection
        Dim Constr As New OleDbConnection
        Constr = Con.ConnectionString()
        Dim dt As New DataTable

        '************* get info************
        dt.Clear()
        Dim mysqlStr = SearchString
        Dim cmd As OleDbDataAdapter = New OleDbDataAdapter(mysqlStr, Constr)
        Dim commandBuilderAllData As New OleDbCommandBuilder(cmd)
        cmd.Fill(dt)

        '*******************************************************
        Return dt

    End Function

End Class